import numpy as np
import torch
# a=torch.randint(0,512,(10,))
# print(a)


# batch_indices = torch.arange(10, dtype=torch.long)
# print(batch_indices)

# a=[1,2,3];
# for i,b in enumerate(a):
#     print(i)
#     print(b)


batch1 = torch.randn(10, 20, 3)
batch2 = torch.randn(10,3, 3)
res = torch.bmm(batch1, batch2)
print(res.size())



# x=torch.randn(2,5,3)
# print(x)
# x = torch.max(x, 2, keepdim=True)[0]
# print(x)
# x=x.view(-1,5)
# print(x)
# print(a)








# xyz=torch.randn(5,10,3)
# centroid=torch.randn(5,1,3)
# idx=torch.ones(5,10)*100000
#
#
# view_shape = list(idx.shape)  #将idx.shape返回的东西，变成list 【5，10】
# view_shape[1:] = [1] * (len(view_shape) - 1)
# repeat_shape = list(idx.shape)
# repeat_shape[0] = 1
# batch_indices = torch.arange(5, dtype=torch.long).to('cuda').view(view_shape).repeat(repeat_shape)
# print(batch_indices)


# print(distance.shape)
# a=list(distance.shape)
# a[1:]=[1] * (len(a) - 1)
# print(a)

# dist = torch.sum((xyz - centroid) ** 2, -1)  #xyz中一行对应的数据就为一个模型的所有坐标点，求差，平方和都是每一ihang对应
# mask = dist < distance  #dist一行的数与distance中一行的所有数进行对比，每对比一个返回一个bool值，组成数组
# distance[mask] = dist[mask]
# farthest = torch.max(distance, -1)[1]